Skip to content

Add WASI versioning infrastructure and convert wasmtime page#340

Open
ericgregory wants to merge 3 commits intobytecodealliance:mainfrom
ericgregory:wasi-p3-versioning-infra
Open

Add WASI versioning infrastructure and convert wasmtime page#340
ericgregory wants to merge 3 commits intobytecodealliance:mainfrom
ericgregory:wasi-p3-versioning-infra

Conversation

@ericgregory
Copy link
Copy Markdown

The WASI P3 release is approaching, and the Component Model Book needs a way to present content that differs
between P2 and P3 without forking pages or duplicating sections. This PR introduces the infrastructure for that (tabbed content blocks and a version notice admonition) and demonstrates the pattern on one real content page (/running-components/wasmtime.html).

Major changes:

  • Add mdbook-tabs preprocessor (v0.2.3 for wire-protocol compatibility with the pinned mdbook 0.4.21) and register theme/tabs.css + theme/tabs.js in book.toml
  • Convert running-components/wasmtime.md to use tabs for the two version-sensitive sections (intro and HTTP
    serving), leaving the wasmtime run and custom-exports sections untabbed since they behave identically across versions

Introduces tabbed content support for WASI P2/P3 via the mdbook-tabs
preprocessor, a version-notice component, and demonstrates the pattern
on the Wasmtime running-components page.

- Add mdbook-tabs preprocessor and installed tabs.css/tabs.js assets
- Customize tab label colors to use --sidebar-active per theme, with
  a Rust-theme override where the orange accent loses contrast on tan
- Add theme/version-notice.css for a branded, theme-aware notice bar
- Register the new CSS/JS in book.toml
- Convert running-components/wasmtime.md to tabbed P2/P3 content,
  hedging wasmtime serve claims against current release notes
- Update links to the WebAssembly/WASI monorepo (wasi-cli and
  wasi-http were archived 2025-11-25)
- Correct the wasmtime serve availability claim from v14.0.3 to v18.0.0
  to match the Wasmtime CLI documentation
Supports shareable deep links with a ?wasi=p2 or ?wasi=p3 query
parameter. On page load, the parameter selects the matching tab
(and persists via the existing localStorage mechanism). Clicking
a tab updates the URL via history.replaceState.

- Add theme/tabs-url-sync.js alongside the mdbook-tabs plugin's
  tabs.js. The companion script runs after the plugin's handler,
  reads the URL on load, and listens for tab clicks via delegation.
- Register the new file in book.toml under additional-js
- Backward compatible: pages without the parameter retain the
  existing localStorage-based behavior
Four enhancements to the tabs infrastructure:

- A new theme/tabs-a11y.js layers ARIA roles and keyboard navigation
  onto the plugin's markup: role=tablist, role=tab, role=tabpanel,
  aria-selected, aria-controls, aria-labelledby, aria-hidden, and
  roving-tabindex arrow-key navigation with Home/End support
- Extend theme/tabs-url-sync.js so a URL hash targeting an element
  inside a hidden tab pane activates the enclosing tab and scrolls
  the target into view
- Print stylesheet: reveal all tab panes with a heading-style label
  and hide the interactive nav under @media print
- Relocate tab style overrides from theme/tabs.css into a new
  theme/tabs-overrides.css so future `mdbook-tabs install` runs
  cannot overwrite them
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant